function C = Curvature(data)
    %计算离散曲率图
    %增加-1 n+1点 变为Q
    data_rows = size(data,1);
    Q = zeros(data_rows+2, 2);
    Q(1,:) = 2*data(1,:) - data(2,:);
    Q(2:data_rows+1,:) = data;
    Q(data_rows+2,:) = 2*data(data_rows,:) - data(data_rows-1,:);
    %迭代计算
    C = zeros(1,data_rows);
    for i = 2:data_rows+1
        Li = norm(Q(i,:) - Q(i-1,:));
        Li_1 = norm(Q(i+1,:) - Q(i,:));
        Mi = norm(Q(i+1,:) - Q(i-1,:));
        %三角形 有向面积
        D = ones(3);
        for j = 1:3
            D(j,1:2) = Q(i+j-2,:);
        end
        S = det(D) / 2;
        %计算离散曲率
        C(i-1) = 2*(Li+Li_1)^2 * S / (Li*Li_1 * Mi^3);
    end
end
